package com.bjshiwei.zhengu.ui.fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;

import com.bjshiwei.zhengu.R;

/**
 * 作者：Administrator on 2017/2/13 0013 10:29
 * 邮箱：sanjins@126.com
 */


public class ZGFragment  extends BaseFragment{

    private ImageView mImageViewPic;
    private RotateAnimation mRotateAnimation;
    private AlphaAnimation mAlphaAnimation;
    private AnimationSet mAnimationSet;
    @Override
    protected void setListener() {

    }

    @Override
    protected void setData() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected View initView(LayoutInflater inflater) {
        View inflate = inflater.inflate(R.layout.fragment_zg, null);
        return inflate;
    }

    @Override
    protected void initFindViewById(View view) {
        mImageViewPic = (ImageView) view.findViewById(R.id.iv_zg_head);
        mAnimationSet = new AnimationSet(true);
        mRotateAnimation = new RotateAnimation(0,36000,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
        mRotateAnimation.setDuration(300000);
        mRotateAnimation.setFillAfter(true);
        mRotateAnimation.setRepeatCount(-1);
        mRotateAnimation.setInterpolator(new LinearInterpolator());
        mAnimationSet.addAnimation(mRotateAnimation);

        mAlphaAnimation = new AlphaAnimation(1.0f,0.8f);
        mAlphaAnimation.setDuration(5000);
        mAlphaAnimation.setFillAfter(true);
        mAlphaAnimation.setRepeatMode(Animation.REVERSE);
        mAlphaAnimation.setInterpolator(new LinearInterpolator());
        mAlphaAnimation.setRepeatCount(-1);
        mAnimationSet.addAnimation(mAlphaAnimation);

        mImageViewPic.startAnimation(mAnimationSet);
    }
}
